﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DiPlaner
{
    public partial class DB_Details : Form
    {
        public string key;
        public string routine;

        public DB_Details()
        {
            InitializeComponent();
        }

        private void bt_save_Click(object sender, EventArgs e)
        {
            if (tx_login.Text.Length >= 3 && tx_routine.Text.Length >= 3)
            {
                key = tx_login.Text;
                routine = tx_routine.Text;
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }
            else bt_save.Enabled = false;
        }

        private void tx_login_TextChanged(object sender, EventArgs e)
        {
            if (tx_login.Text.Length >= 3 && tx_routine.Text.Length >= 3) bt_save.Enabled = true;
            else bt_save.Enabled = false;
        }

        private void tx_routine_TextChanged(object sender, EventArgs e)
        {
            if (tx_login.Text.Length >= 3 && tx_routine.Text.Length >= 3) bt_save.Enabled = true;
            else bt_save.Enabled = false;
        }
    }
}
